package com.heima.feigins;

import com.heima.config.HeimaFeiginAutoConfiguration;
import com.heima.feigins.fallback.AdminFeiginFallback;
import com.heima.model.admin.pojos.AdChannel;
import com.heima.model.admin.pojos.AdSensitive;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(value = "leadnews-admin",fallbackFactory = AdminFeiginFallback.class,configuration = HeimaFeiginAutoConfiguration.class)
public interface AdminFeign {
    /*
    * 查询所有敏感词
    * */
    @PostMapping("/api/v1/sensitive/sensitives")
    public ResponseResult<List<String>> selectAllSensitive();

    /*
    * 根据id查询频道信息
    * */
    @GetMapping("/api/v1/channel/one/{id}")
    public ResponseResult<AdChannel> findOne(@PathVariable Integer id);
}
